﻿@model DataBaseLayer.Dto.GalleryData
@{
	ViewBag.Title = Model != null ? Model.Name : "Галерея";
}

@if (Model != null)
{
	<div>
		<span>
			<h2>@(Model.Name ?? string.Empty)</h2>
		</span>
	</div>
	
	<div class="back">
		@if (Model.IsImagesGallery)
		{
			<a href="@(Url.Action<GalleriesController>(m => m.Index(Model.PageNumber)))">Назад</a>
		}
		else
		{
			<a href="@(Url.Action<FotoClubController>(m => m.Index(Model.PageNumber)))">Назад</a>
		}
	</div>

	if (Model.Images != null && Model.Images.Any())
	{
		<div id="content-slider">
			<div id="galleria">
				@foreach (var image in Model.Images)
				{
					<a href="..\..\@image.Url"><img src="..\..\@image.UrlThumb" data-title="" data-description="" /></a>
				}
			</div>
		</div>
	}
}

<script type="text/javascript">
	// Load the classic theme
	Galleria.loadTheme('/Scripts/galleria.classic.js');
	// Initialize Galleria
	Galleria.run('#galleria');
</script>
